package com.company.cloud.user.modules.app.utils;

import cn.hutool.extra.mail.MailUtil;
import com.company.cloud.common.utils.PasswordUtils;
import com.company.cloud.user.constant.UserMsgSendTypeEnum;

import cn.hutool.core.util.StrUtil;

public class UserVCodeUtils {
	
	/**
	 * 验证码KEY
	 * */
	public static String getVCodeKey(String companyNo, UserMsgSendTypeEnum sendType, String mobile) {
		return StrUtil.format("UVC:{}:{}:{}", companyNo,sendType.getCode(),mobile);
	}


	public static void main(String[] args) {
		System.out.println(UserVCodeUtils.getVCodeKey("PTC",UserMsgSendTypeEnum.Login_VCode,"18883838383"));
	}
	
	/**
	 * 
	 * */
	
	
	
//	/**
//	 * 验证验证码
//	 * */
//	public static void validate(RedisUtils redisUtils,String vkey, String vcode,boolean isOkDel) throws BusinessException {
//		String code = redisUtils.get(vkey);
//		if (code == null || "".equals(code)) {
//			throw new BusinessException(UserErrorEnum.VCode_User_Expire);
//		}
//		if (!code.equals(vcode)) {
//			throw new BusinessException(UserErrorEnum.VCode_User_Error);
//		}
//		if(isOkDel) {
//			redisUtils.delete(vkey);
//		}
//	}

	
	
	
	
	

}
